from torch._dynamo.variables import torch
from ultralytics import YOLO
from fastapi import Depends
from app.config.settings import settings


def get_model():
    model = YOLO(settings.model_path).to('cuda' if torch.cuda.is_available() else 'cpu')
    return model


ModelDep = Depends(get_model)
